package com.blb.aop.servlet;

import com.blb.aop.entity.Student;
import com.blb.aop.service.StudentService;
import com.blb.aop.util.AspectConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class StudentServlet {
    public static void main(String[] args) {
        //创建容器
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AspectConfig.class);
        //通过容器获得对象
        StudentService studentService = context.getBean(StudentService.class);
        Student student = new Student(1l, "张三", 30, "男");
        studentService.save(student);
        studentService.modify(student);
        studentService.remove(1L);
        studentService.findById(1L);
    }


}
